package com.ruoyi.control.service.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.control.mapper.HfhjsOneMapper;
import com.ruoyi.control.domain.HfhjsOne;
import com.ruoyi.control.service.IHfhjsOneService;

/**
 * 11401回风巷局扇Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
public class HfhjsOneServiceImpl extends ServiceImpl<HfhjsOneMapper, HfhjsOne> implements IHfhjsOneService //修改
{
    @Autowired
    private HfhjsOneMapper hfhjsOneMapper;

    /**
     * 查询11401回风巷局扇
     * 
     * @param tagName 11401回风巷局扇主键
     * @return 11401回风巷局扇
     */
    @Override
    public HfhjsOne selectHfhjsOneByTagName(String tagName)
    {
        return hfhjsOneMapper.selectHfhjsOneByTagName(tagName);
    }

    /**
     * 查询11401回风巷局扇列表
     * 
     * @param hfhjsOne 11401回风巷局扇
     * @return 11401回风巷局扇
     */
    @Override
    public List<HfhjsOne> selectHfhjsOneList(HfhjsOne hfhjsOne)
    {
        return hfhjsOneMapper.selectHfhjsOneList(hfhjsOne);
    }

    /**
     * 新增11401回风巷局扇
     * 
     * @param hfhjsOne 11401回风巷局扇
     * @return 结果
     */
    @Override
    public int insertHfhjsOne(HfhjsOne hfhjsOne)
    {
        return hfhjsOneMapper.insertHfhjsOne(hfhjsOne);
    }

    /**
     * 修改11401回风巷局扇
     * 
     * @param hfhjsOne 11401回风巷局扇
     * @return 结果
     */
    @Override
    public int updateHfhjsOne(HfhjsOne hfhjsOne)
    {
        hfhjsOne.setUpdateTime(DateUtils.getNowDate());
        return hfhjsOneMapper.updateHfhjsOne(hfhjsOne);
    }

    /**
     * 批量删除11401回风巷局扇
     * 
     * @param tagNames 需要删除的11401回风巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteHfhjsOneByTagNames(String[] tagNames)
    {
        return hfhjsOneMapper.deleteHfhjsOneByTagNames(tagNames);
    }

    /**
     * 删除11401回风巷局扇信息
     * 
     * @param tagName 11401回风巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteHfhjsOneByTagName(String tagName)
    {
        return hfhjsOneMapper.deleteHfhjsOneByTagName(tagName);
    }
    /**
     * 查询前端显示数据
     * @return
     */
    @Override
    public List<HfhjsOne> getList() {
        List<HfhjsOne> hfhjsOneList = new ArrayList<>();
        List<String> fanData = Arrays.asList("JKMS","JXMS","YKMS","ZJDY","ZJYJDJDY","ZJEJDJDY","YTJWZ","ZJDJWD","FL","FS","BJDY","BJDJWD","BJYJDJDY","BJEJDJDY","JDJWZ");
        for (String fanDatum : fanData) {
            HfhjsOne hfhjsOne = hfhjsOneMapper.selectHfhjsOneByTagName(fanDatum);
            hfhjsOneList.add(hfhjsOne);
        }
        return hfhjsOneList;
    }
}
